package com.tailyou.androidlearning202400.kl


//集合：List.Set,Map
//集合API:集合的常用方法
fun main() {
    //listOf创建不可变集合
    //不可变集合，不能增减元素
    //mapOf()
    //setOf()
    val names = listOf("YJW","WPY","YYY")
    //集合遍历
    for (name in names){
        println(name)
    }

    //mutableListOf创建可变集合
    //mutableMapOf()
    //mutableSetOf()
    val names2 = mutableListOf("YJW","WPY","YYY")
    names2.add("YHH")
    names2.add(0,"LLL")
    //集合遍历
    for (name in names2){
        println(name)
    }

    //找出所有姓Y的明星
}